//
//  NoDataCell.m
//  operativeSide
//
//  Created by 王春程 on 16/6/13.
//  Copyright © 2016年 com.caocaod.www. All rights reserved.
//

#import "NoDataCell.h"
#import "Masonry.h"
@interface NoDataCell()
@property (strong, nonatomic)                   UIImageView *noDataimageView;
@property (strong, nonatomic)                   UILabel *tilLabel;
@end
@implementation NoDataCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initSubView];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)setTilString:(NSString *)tilString {
    _tilString = tilString;
    self.tilLabel.text = tilString;
}

- (void)setNoDataImage:(UIImage *)noDataImage {
    _noDataImage = noDataImage;
    self.noDataimageView.image = noDataImage;
}

- (void)initSubView {
    WS(weakSelf);
    self.backgroundColor = RGB(232, 232, 232);
    _noDataimageView = [[UIImageView alloc] init];
    _noDataimageView.userInteractionEnabled = YES;
    [_noDataimageView setContentMode:UIViewContentModeCenter];
    [self.contentView addSubview:self.noDataimageView];
    [_noDataimageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(weakSelf.contentView.mas_centerY).offset(-30);
        make.centerX.mas_equalTo(weakSelf.contentView.mas_centerX);
        make.size.mas_equalTo(CGSizeMake(42, 42));
    }];
    
    
    _tilLabel = [[UILabel alloc] init];
    _tilLabel.textColor = RGB(153, 153, 153);
    _tilLabel.textAlignment = NSTextAlignmentCenter;
    _tilLabel.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:self.tilLabel];
    [_tilLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakSelf.noDataimageView.mas_bottom).offset(15);
        make.left.mas_equalTo(weakSelf.contentView.mas_left);
        make.size.mas_equalTo(CGSizeMake(VIEW_WIDTH, 15));
    }];
    
}

@end
